package com.sniff.atp.service.database.impl;

import com.sniff.atp.entity.ExecuteRecord;
import com.sniff.atp.manager.ExecuteRecordManager;
import com.sniff.atp.service.database.ExecuteRecordService;
import com.sniff.atp.utils.DateUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @BelongsProject: sniff-atp
 * @BelongsPackage: com.sniff.atp.service.database.impl
 * @Author: zxy
 * @CreateTime: 2022-11-22 16:32
 * @Description: 保存执行记录
 * @Version: 1.0
 */
@Service
@RequiredArgsConstructor
public class ExecuteRecordServiceImpl implements ExecuteRecordService {
    private final ExecuteRecordManager executeRecordManager;

    @Override
    public void addOne(String req_url, String req_header, String req_body, String resp_code, String resp_header, String resp_body) {
        ExecuteRecord executeRecord = new ExecuteRecord();
        executeRecord.setReq_url(req_url);
        executeRecord.setReq_header(req_header);
        executeRecord.setReq_body(req_body);
        executeRecord.setResp_code(resp_code);
        executeRecord.setResp_header(resp_header);
        executeRecord.setResp_body(resp_body);
        executeRecordManager.saveOne(executeRecord);
    }
}
